<template>
  <div class="w-full h-full">
    <Echarts :option="option" />
  </div>
</template>

<script setup>
  import Echarts from '@/components/common/index.vue'

  const option = ref({
    tooltip: {
      trigger: 'item',
    },
    legend: {
      top: '5%',
      left: 'center',
    },
    series: [
      {
        name: '测试饼图',
        type: 'pie',
        radius: ['40%', '70%'],
        avoidLabelOverlap: false,
        itemStyle: {
          borderRadius: 10,
        },
        label: {
          show: false,
          position: 'center',
        },
        emphasis: {
          label: {
            show: true,
            fontSize: 22,
            fontWeight: 'bold',
          },
        },
        labelLine: {
          show: false,
        },
        data: [
          { value: 1048, name: '测试1' },
          { value: 735, name: '测试2' },
          { value: 580, name: '测试3' },
          { value: 484, name: '测试4' },
          { value: 300, name: '测试5' },
        ],
      },
    ],
  })
</script>
